//
//  AppDelegate.m
//  CareRing
//
//  Created  on 2024/12/11.
//
    

#import "AppDelegate.h"
#import "CAMainVc.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    if (launchOptions[UIApplicationLaunchOptionsBluetoothCentralsKey]) {
        // 这里可以设置标志位，表示需要进行状态恢复
        NSLog(@"App因蓝牙状态恢复被启动");
    }
    
    [self initWindow];
    return YES;
}

-(void)initWindow {
    
    if (self.window == nil) {
        self.window = [[UIWindow alloc]initWithFrame: [UIScreen mainScreen].bounds];
        
        UINavigationController *nav = [[UINavigationController alloc] init];
       
        
        if (@available(iOS 15.0, *)) {
            UINavigationBarAppearance *appearance = [UINavigationBarAppearance new];
            [appearance configureWithOpaqueBackground];
            appearance.backgroundColor = UIColor.whiteColor;
            nav.navigationBar.standardAppearance = appearance;
            nav.navigationBar.scrollEdgeAppearance = nav.navigationBar.standardAppearance;
        }
        
        self.window.rootViewController = nav;
        [self.window makeKeyAndVisible];
        
        [nav pushViewController:[CAMainVc new] animated:NO];
    }
    
}



@end
